AmCharts.AmSerialChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(t){this.type="serial";AmCharts.AmSerialChart.base.construct.call(this,t);this.cname="AmSerialChart";this.theme=t;this.createEvents("changed");this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=.8;this.updateScrollbar=!0;var e=new AmCharts.CategoryAxis(t);e.chart=this;this.categoryAxis=e;this.zoomOutOnDataUpdate=!0;this.mouseWheelZoomEnabled=this.mouseWheelScrollEnabled=this.rotate=this.skipZoom=!1;this.minSelectedTime=0;AmCharts.applyTheme(this,t,this.cname)},initChart:function(){AmCharts.AmSerialChart.base.initChart.call(this);this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);var t=this.chartCursor;t&&(t.updateData(),t.fullWidth&&(t.fullRectSet=this.cursorLineSet));var t=this.countColumns(),e=this.graphs,i;for(i=0;i<e.length;i++)e[i].columnCount=t;this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=!0,this.measureMargins())},handleWheelReal:function(t,e){if(!this.wheelBusy){var i=this.categoryAxis,s=i.parseDates,a=i.minDuration(),h=i=1;this.mouseWheelZoomEnabled?e||(i=-1):e&&(i=-1);var r=this.chartData.length,o=this.lastTime,n=this.firstTime;0>t?s?(r=this.endTime-this.startTime,s=this.startTime+i*a,a=this.endTime+h*a,0<h&&0<i&&a>=o&&(a=o,s=o-r),this.zoomToDates(new Date(s),new Date(a))):(0<h&&0<i&&this.end>=r-1&&(i=h=0),s=this.start+i,a=this.end+h,this.zoomToIndexes(s,a)):s?(r=this.endTime-this.startTime,s=this.startTime-i*a,a=this.endTime-h*a,0<h&&0<i&&s<=n&&(s=n,a=n+r),this.zoomToDates(new Date(s),new Date(a))):(0<h&&0<i&&1>this.start&&(i=h=0),s=this.start-i,a=this.end-h,this.zoomToIndexes(s,a))}},validateData:function(t){this.marginsUpdated=!1;this.zoomOutOnDataUpdate&&!t&&(this.endTime=this.end=this.startTime=this.start=NaN);AmCharts.AmSerialChart.base.validateData.call(this)},drawChart:function(){AmCharts.AmSerialChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t)){var e=this.chartScrollbar;e&&e.draw();if(0<this.realWidth&&0<this.realHeight){var t=t.length-1,i,e=this.categoryAxis;if(e.parseDates&&!e.equalSpacing){if(e=this.startTime,i=this.endTime,isNaN(e)||isNaN(i))e=this.firstTime,i=this.lastTime}else if(e=this.start,i=this.end,isNaN(e)||isNaN(i))e=0,i=t;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(e,i)}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor])},updateCategoryAxis:function(t,e,i){t.chart=this;t.id=i;t.rotate=e;t.axisRenderer=AmCharts.RecAxis;t.guideFillRenderer=AmCharts.RecFill;t.axisItemRenderer=AmCharts.RecItem;t.setOrientation(!this.rotate);t.x=this.marginLeftReal;t.y=this.marginTopReal;t.dx=this.dx;t.dy=this.dy;t.width=this.plotAreaWidth-1;t.height=this.plotAreaHeight-1;t.viW=this.plotAreaWidth-1;t.viH=this.plotAreaHeight-1;t.viX=this.marginLeftReal;t.viY=this.marginTopReal;t.marginsChanged=!0},updateValueAxes:function(){AmCharts.AmSerialChart.base.updateValueAxes.call(this);var t=this.valueAxes,e;for(e=0;e<t.length;e++){var i=t[e],s=this.rotate;i.rotate=s;i.setOrientation(s);s=this.categoryAxis;if(!s.startOnAxis||s.parseDates)i.expandMinMax=!0}},updateData:function(){this.parseData();var t=this.graphs,e,i=this.chartData;for(e=0;e<t.length;e++)t[e].data=i;0<i.length&&(this.firstTime=this.getStartTime(i[0].time),this.lastTime=this.getEndTime(i[i.length-1].time))},getStartTime:function(t){var e=this.categoryAxis;return AmCharts.resetDateToMin(new Date(t),e.minPeriod,1,e.firstDayOfWeek).getTime()},getEndTime:function(t){var e=AmCharts.extractPeriod(this.categoryAxis.minPeriod);return AmCharts.changeDate(new Date(t),e.period,e.count,!0).getTime()-1},updateMargins:function(){AmCharts.AmSerialChart.base.updateMargins.call(this);var t=this.chartScrollbar;t&&(this.getScrollbarPosition(t,this.rotate,this.categoryAxis.position),this.adjustMargins(t,this.rotate))},updateScrollbars:function(){AmCharts.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate)},zoom:function(t,e){var i=this.categoryAxis;i.parseDates&&!i.equalSpacing?this.timeZoom(t,e):this.indexZoom(t,e);this.updateLegendValues()},timeZoom:function(t,e){var i=this.maxSelectedTime;isNaN(i)||(e!=this.endTime&&e-t>i&&(t=e-i,this.updateScrollbar=!0),t!=this.startTime&&e-t>i&&(e=t+i,this.updateScrollbar=!0));var s=this.minSelectedTime;if(0<s&&e-t<s){var a=Math.round(t+(e-t)/2),s=Math.round(s/2);t=a-s;e=a+s}var h=this.chartData,a=this.categoryAxis;if(AmCharts.ifArray(h)&&(t!=this.startTime||e!=this.endTime)){var r=a.minDuration(),s=this.firstTime,o=this.lastTime;t||(t=s,isNaN(i)||(t=o-i));e||(e=o);t>o&&(t=o);e<s&&(e=s);t<s&&(t=s);e>o&&(e=o);e<t&&(e=t+r);e-t<r/5&&(e<o?e=t+r/5:t=e-r/5);this.startTime=t;this.endTime=e;i=h.length-1;r=this.getClosestIndex(h,"time",t,!0,0,i);h=this.getClosestIndex(h,"time",e,!1,r,i);a.timeZoom(t,e);a.zoom(r,h);this.start=AmCharts.fitToBounds(r,0,i);this.end=AmCharts.fitToBounds(h,0,i);this.zoomAxesAndGraphs();this.zoomScrollbar();t!=s||e!=o?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchTimeZoomEvent()}},indexZoom:function(t,e){var i=this.maxSelectedSeries;isNaN(i)||(e!=this.end&&e-t>i&&(t=e-i,this.updateScrollbar=!0),t!=this.start&&e-t>i&&(e=t+i,this.updateScrollbar=!0));if(t!=this.start||e!=this.end){var s=this.chartData.length-1;isNaN(t)&&(t=0,isNaN(i)||(t=s-i));isNaN(e)&&(e=s);e<t&&(e=t);e>s&&(e=s);t>s&&(t=s-1);0>t&&(t=0);this.start=t;this.end=e;this.categoryAxis.zoom(t,e);this.zoomAxesAndGraphs();this.zoomScrollbar();0!==t||e!=this.chartData.length-1?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchIndexZoomEvent()}},updateGraphs:function(){AmCharts.AmSerialChart.base.updateGraphs.call(this);var t=this.graphs,e;for(e=0;e<t.length;e++){var i=t[e];i.columnWidthReal=this.columnWidth;i.categoryAxis=this.categoryAxis;AmCharts.isString(i.fillToGraph)&&(i.fillToGraph=this.getGraphById(i.fillToGraph))}},updateColumnsDepth:function(){var t,e=this.graphs,i;AmCharts.remove(this.columnsSet);this.columnsArray=[];for(t=0;t<e.length;t++){i=e[t];var s=i.columnsArray;if(s){var a;for(a=0;a<s.length;a++)this.columnsArray.push(s[a])}}this.columnsArray.sort(this.compareDepth);if(0<this.columnsArray.length){e=this.container.set();this.columnSet.push(e);for(t=0;t<this.columnsArray.length;t++)e.push(this.columnsArray[t].column.set);i&&e.translate(i.x,i.y);this.columnsSet=e}},compareDepth:function(t,e){return t.depth>e.depth?1:-1},zoomScrollbar:function(){var t=this.chartScrollbar,e=this.categoryAxis;t&&this.updateScrollbar&&t.enabled&&(t.dragger.stop(),e.parseDates&&!e.equalSpacing?t.timeZoom(this.startTime,this.endTime):t.zoom(this.start,this.end),this.updateScrollbar=!0)},updateTrendLines:function(){var t=this.trendLines,e;for(e=0;e<t.length;e++){var i=t[e],i=AmCharts.processObject(i,AmCharts.TrendLine,this.theme);t[e]=i;i.chart=this;i.id||(i.id="trendLineAuto"+e+"_"+(new Date).getTime());AmCharts.isString(i.valueAxis)&&(i.valueAxis=this.getValueAxisById(i.valueAxis));i.valueAxis||(i.valueAxis=this.valueAxes[0]);i.categoryAxis=this.categoryAxis}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var t=this.valueAxes,e;for(e=0;e<t.length;e++)t[e].zoom(this.start,this.end);t=this.graphs;for(e=0;e<t.length;e++)t[e].zoom(this.start,this.end);this.zoomTrendLines();(e=this.chartCursor)&&e.zoom(this.start,this.end,this.startTime,this.endTime)}},countColumns:function(){var t=0,e=this.valueAxes.length,i=this.graphs.length,s,a,h=!1,r,o;for(o=0;o<e;o++){a=this.valueAxes[o];var n=a.stackType;if("100%"==n||"regular"==n)for(h=!1,r=0;r<i;r++)s=this.graphs[r],s.tcc=1,s.valueAxis==a&&"column"==s.type&&(!h&&s.stackable&&(t++,h=!0),(!s.stackable&&s.clustered||s.newStack)&&t++,s.columnIndex=t-1,s.clustered||(s.columnIndex=0));if("none"==n||"3d"==n){h=!1;for(r=0;r<i;r++)s=this.graphs[r],s.valueAxis==a&&"column"==s.type&&(s.clustered?(s.tcc=1,s.newStack&&(t=0),s.hidden||(s.columnIndex=t,t++)):s.hidden||(h=!0,s.tcc=1,s.columnIndex=0));h&&0==t&&(t=1)}if("3d"==n){a=1;for(o=0;o<i;o++)s=this.graphs[o],s.newStack&&a++,s.depthCount=a,s.tcc=t;t=a}}return t},parseData:function(){AmCharts.AmSerialChart.base.parseData.call(this);this.parseSerialData()},getCategoryIndexByValue:function(t){var e=this.chartData,i,s;for(s=0;s<e.length;s++)e[s].category==t&&(i=s);return i},handleCursorChange:function(t){this.updateLegendValues(t.index)},handleCursorZoom:function(t){this.updateScrollbar=!0;this.zoom(t.start,t.end)},handleScrollbarZoom:function(t){this.updateScrollbar=!1;this.zoom(t.start,t.end)},dispatchTimeZoomEvent:function(){if(this.prevStartTime!=this.startTime||this.prevEndTime!=this.endTime){var t={type:"zoomed"};t.startDate=new Date(this.startTime);t.endDate=new Date(this.endTime);t.startIndex=this.start;t.endIndex=this.end;this.startIndex=this.start;this.endIndex=this.end;this.startDate=t.startDate;this.endDate=t.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var e=this.categoryAxis,i=AmCharts.extractPeriod(e.minPeriod).period,e=e.dateFormatsObject[i];t.startValue=AmCharts.formatDate(t.startDate,e,this);t.endValue=AmCharts.formatDate(t.endDate,e,this);t.chart=this;t.target=this;this.fire(t.type,t)}},dispatchIndexZoomEvent:function(){if(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end){this.startIndex=this.start;this.endIndex=this.end;var t=this.chartData;if(AmCharts.ifArray(t)&&!isNaN(this.start)&&!isNaN(this.end)){var e={chart:this,target:this,type:"zoomed"};e.startIndex=this.start;e.endIndex=this.end;e.startValue=t[this.start].category;e.endValue=t[this.end].category;this.categoryAxis.parseDates&&(this.startTime=t[this.start].time,this.endTime=t[this.end].time,e.startDate=new Date(this.startTime),e.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(e.type,e)}}},updateLegendValues:function(t){var e=this.graphs,i;for(i=0;i<e.length;i++){var s=e[i];isNaN(t)?s.currentDataItem=void 0:s.currentDataItem=this.chartData[t].axes[s.valueAxis.id].graphs[s.id]}this.legend&&this.legend.updateValues()},getClosestIndex:function(t,e,i,s,a,h){0>a&&(a=0);h>t.length-1&&(h=t.length-1);var r=a+Math.round((h-a)/2),o=t[r][e];if(i==o)return r;if(1>=h-a){if(s)return a;s=t[h][e];return Math.abs(t[a][e]-i)<Math.abs(s-i)?a:h}return i==o?r:i<o?this.getClosestIndex(t,e,i,s,a,r):this.getClosestIndex(t,e,i,s,r,h)},zoomToIndexes:function(t,e){this.updateScrollbar=!0;var i=this.chartData;if(i){var s=i.length;0<s&&(0>t&&(t=0),e>s-1&&(e=s-1),s=this.categoryAxis,s.parseDates&&!s.equalSpacing?this.zoom(i[t].time,this.getEndTime(i[e].time)):this.zoom(t,e))}},zoomToDates:function(t,e){this.updateScrollbar=!0;var i=this.chartData;if(this.categoryAxis.equalSpacing){var s=this.getClosestIndex(i,"time",t.getTime(),!0,0,i.length);e=AmCharts.resetDateToMin(e,this.categoryAxis.minPeriod,1);i=this.getClosestIndex(i,"time",e.getTime(),!1,0,i.length);this.zoom(s,i)}else this.zoom(t.getTime(),e.getTime())},zoomToCategoryValues:function(t,e){this.updateScrollbar=!0;this.zoom(this.getCategoryIndexByValue(t),this.getCategoryIndexByValue(e))},formatPeriodString:function(t,e){if(e){var i=["value","open","low","high","close"],s="value open low high close average sum count".split(" "),a=e.valueAxis,h=this.chartData,r=e.numberFormatter;r||(r=this.nf);for(var o=0;o<i.length;o++){for(var n=i[o],d=0,m=0,l,c,u,g,p,f=0,A=0,C,x,D,v,T,b=this.start;b<=this.end;b++){var N=h[b];if(N&&(N=N.axes[a.id].graphs[e.id])){if(N.values){var y=N.values[n];if(this.rotate){if(0>N.x||N.x>N.graph.height)y=NaN}else if(0>N.x||N.x>N.graph.width)y=NaN;if(!isNaN(y)){isNaN(l)&&(l=y);c=y;if(isNaN(u)||u>y)u=y;if(isNaN(g)||g<y)g=y;p=AmCharts.getDecimals(d);var M=AmCharts.getDecimals(y),d=d+y,d=AmCharts.roundTo(d,Math.max(p,M));m++;p=d/m}}if(N.percents&&(N=N.percents[n],!isNaN(N))){isNaN(C)&&(C=N);x=N;if(isNaN(D)||D>N)D=N;if(isNaN(v)||v<N)v=N;T=AmCharts.getDecimals(f);y=AmCharts.getDecimals(N);f+=N;f=AmCharts.roundTo(f,Math.max(T,y));A++;T=f/A}}}f={open:C,close:x,high:v,low:D,average:T,sum:f,count:A};t=AmCharts.formatValue(t,{open:l,close:c,high:g,low:u,average:p,sum:d,count:m},s,r,n+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,f,s,this.pf,"percents\\."+n+"\\.")}}return t=AmCharts.cleanFromEmpty(t)},formatString:function(t,e,i){var s=e.graph;if(-1!=t.indexOf("[[category]]")){var a=e.serialDataItem.category;if(this.categoryAxis.parseDates){var h=this.balloonDateFormat,r=this.chartCursor;r&&(h=r.categoryBalloonDateFormat);-1!=t.indexOf("[[category]]")&&(h=AmCharts.formatDate(a,h,this),-1!=h.indexOf("fff")&&(h=AmCharts.formatMilliseconds(h,a)),a=h)}t=t.replace(/\[\[category\]\]/g,String(a))}s=s.numberFormatter;s||(s=this.nf);a=e.graph.valueAxis;(h=a.duration)&&!isNaN(e.values.value)&&(a=AmCharts.formatDuration(e.values.value,h,"",a.durationUnits,a.maxInterval,s),t=t.replace(RegExp("\\[\\[value\\]\\]","g"),a));a="value open low high close total".split(" ");h=this.pf;t=AmCharts.formatValue(t,e.percents,a,h,"percents\\.");t=AmCharts.formatValue(t,e.values,a,s,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,e.values,["percents"],h);-1!=t.indexOf("[[")&&(t=AmCharts.formatDataContextValue(t,e.dataContext));return t=AmCharts.AmSerialChart.base.formatString.call(this,t,e,i)},addChartScrollbar:function(t){AmCharts.callMethod("destroy",[this.chartScrollbar]);t&&(t.chart=this,this.listenTo(t,"zoomed",this.handleScrollbarZoom));this.rotate?void 0===t.width&&(t.width=t.scrollbarHeight):void 0===t.height&&(t.height=t.scrollbarHeight);this.chartScrollbar=t},removeChartScrollbar:function(){AmCharts.callMethod("destroy",[this.chartScrollbar]);this.chartScrollbar=null},handleReleaseOutside:function(t){AmCharts.AmSerialChart.base.handleReleaseOutside.call(this,t);AmCharts.callMethod("handleReleaseOutside",[this.chartScrollbar])}});AmCharts.Cuboid=AmCharts.Class({construct:function(t,e,i,s,a,h,r,o,n,d,m,l,c,u,g,p,f){this.set=t.set();this.container=t;this.h=Math.round(i);this.w=Math.round(e);this.dx=s;this.dy=a;this.colors=h;this.alpha=r;this.bwidth=o;this.bcolor=n;this.balpha=d;this.dashLength=u;this.topRadius=p;this.pattern=g;this.rotate=c;this.bcn=f;c?0>e&&0===m&&(m=180):0>i&&270==m&&(m=90);this.gradientRotation=m;0===s&&0===a&&(this.cornerRadius=l);this.draw()},draw:function(){var t=this.set;t.clear();var e=this.container,i=e.chart,s=this.w,a=this.h,h=this.dx,r=this.dy,o=this.colors,n=this.alpha,d=this.bwidth,m=this.bcolor,l=this.balpha,c=this.gradientRotation,u=this.cornerRadius,g=this.dashLength,p=this.pattern,f=this.topRadius,A=this.bcn,C=o,x=o;"object"==typeof o&&(C=o[0],x=o[o.length-1]);var D,v,T,b,N,y,M,S,w,I=n;p&&(n=0);var P,W,R,F,L=this.rotate;if(0<Math.abs(h)||0<Math.abs(r))if(isNaN(f))M=x,x=AmCharts.adjustLuminosity(C,-.2),x=AmCharts.adjustLuminosity(C,-.2),D=AmCharts.polygon(e,[0,h,s+h,s,0],[0,r,r,0,0],x,n,1,m,0,c),0<l&&(w=AmCharts.line(e,[0,h,s+h],[0,r,r],m,l,d,g)),v=AmCharts.polygon(e,[0,0,s,s,0],[0,a,a,0,0],x,n,1,m,0,c),v.translate(h,r),0<l&&(T=AmCharts.line(e,[h,h],[r,r+a],m,l,d,g)),b=AmCharts.polygon(e,[0,0,h,h,0],[0,a,a+r,r,0],x,n,1,m,0,c),N=AmCharts.polygon(e,[s,s,s+h,s+h,s],[0,a,a+r,r,0],x,n,1,m,0,c),0<l&&(y=AmCharts.line(e,[s,s+h,s+h,s],[0,r,a+r,a],m,l,d,g)),x=AmCharts.adjustLuminosity(M,.2),M=AmCharts.polygon(e,[0,h,s+h,s,0],[a,a+r,a+r,a,a],x,n,1,m,0,c),0<l&&(S=AmCharts.line(e,[0,h,s+h],[a,a+r,a+r],m,l,d,g));else{var O,Y,z;L?(O=a/2,x=h/2,z=a/2,Y=s+h/2,W=Math.abs(a/2),P=Math.abs(h/2)):(x=s/2,O=r/2,Y=s/2,z=a+r/2+1,P=Math.abs(s/2),W=Math.abs(r/2));R=P*f;F=W*f;.1<P&&.1<P&&(D=AmCharts.circle(e,P,C,n,d,m,l,!1,W),D.translate(x,O));.1<R&&.1<R&&(M=AmCharts.circle(e,R,AmCharts.adjustLuminosity(C,.5),n,d,m,l,!1,F),M.translate(Y,z))}n=I;1>Math.abs(a)&&(a=0);1>Math.abs(s)&&(s=0);!isNaN(f)&&(0<Math.abs(h)||0<Math.abs(r))?(o=[C],o={fill:o,stroke:m,"stroke-width":d,"stroke-opacity":l,"fill-opacity":n},L?(n="M0,0 L"+s+","+(a/2-a/2*f),d=" B",0<s&&(d=" A"),AmCharts.VML?(n+=d+Math.round(s-R)+","+Math.round(a/2-F)+","+Math.round(s+R)+","+Math.round(a/2+F)+","+s+",0,"+s+","+a,n=n+(" L0,"+a)+(d+Math.round(-P)+","+Math.round(a/2-W)+","+Math.round(P)+","+Math.round(a/2+W)+",0,"+a+",0,0")):(n+="A"+R+","+F+",0,0,0,"+s+","+(a-a/2*(1-f))+"L0,"+a,n+="A"+P+","+W+",0,0,1,0,0"),P=90):(d=s/2-s/2*f,n="M0,0 L"+d+","+a,AmCharts.VML?(n="M0,0 L"+d+","+a,d=" B",0>a&&(d=" A"),n+=d+Math.round(s/2-R)+","+Math.round(a-F)+","+Math.round(s/2+R)+","+Math.round(a+F)+",0,"+a+","+s+","+a,n+=" L"+s+",0",n+=d+Math.round(s/2+P)+","+Math.round(W)+","+Math.round(s/2-P)+","+Math.round(-W)+","+s+",0,0,0"):(n+="A"+R+","+F+",0,0,0,"+(s-s/2*(1-f))+","+a+"L"+s+",0",n+="A"+P+","+W+",0,0,1,0,0"),P=180),e=e.path(n).attr(o),e.gradient("linearGradient",[C,AmCharts.adjustLuminosity(C,-.3),AmCharts.adjustLuminosity(C,-.3),C],P),L?e.translate(h/2,0):e.translate(0,r/2)):e=0===a?AmCharts.line(e,[0,s],[0,0],m,l,d,g):0===s?AmCharts.line(e,[0,0],[0,a],m,l,d,g):0<u?AmCharts.rect(e,s,a,o,n,d,m,l,u,c,g):AmCharts.polygon(e,[0,0,s,s,0],[0,a,a,0,0],o,n,d,m,l,c,!1,g);s=isNaN(f)?0>a?[D,w,v,T,b,N,y,M,S,e]:[M,S,v,T,b,N,D,w,y,e]:L?0<s?[D,e,M]:[M,e,D]:0>a?[D,e,M]:[M,e,D];AmCharts.setCN(i,e,A+"front");AmCharts.setCN(i,v,A+"back");AmCharts.setCN(i,M,A+"top");AmCharts.setCN(i,D,A+"bottom");AmCharts.setCN(i,b,A+"left");AmCharts.setCN(i,N,A+"right");for(D=0;D<s.length;D++)if(v=s[D])t.push(v),AmCharts.setCN(i,v,A+"element");p&&e.pattern(p)},width:function(t){isNaN(t)&&(t=0);this.w=Math.round(t);this.draw()},height:function(t){isNaN(t)&&(t=0);this.h=Math.round(t);this.draw()},animateHeight:function(t,e){var i=this;i.easing=e;i.totalFrames=Math.round(1e3*t/AmCharts.updateRate);i.rh=i.h;i.frame=0;i.height(1);setTimeout(function(){i.updateHeight.call(i)},AmCharts.updateRate)},updateHeight:function(){var t=this;t.frame++;var e=t.totalFrames;t.frame<=e&&(e=t.easing(0,t.frame,1,t.rh-1,e),t.height(e),setTimeout(function(){t.updateHeight.call(t)},AmCharts.updateRate))},animateWidth:function(t,e){var i=this;i.easing=e;i.totalFrames=Math.round(1e3*t/AmCharts.updateRate);i.rw=i.w;i.frame=0;i.width(1);setTimeout(function(){i.updateWidth.call(i)},AmCharts.updateRate)},updateWidth:function(){var t=this;t.frame++;var e=t.totalFrames;t.frame<=e&&(e=t.easing(0,t.frame,1,t.rw-1,e),t.width(e),setTimeout(function(){t.updateWidth.call(t)},AmCharts.updateRate))}});AmCharts.CategoryAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(t){this.cname="CategoryAxis";AmCharts.CategoryAxis.base.construct.call(this,t);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.firstDayOfWeek=1;this.gridPosition="middle";this.markPeriodChange=this.boldPeriodBeginning=!0;this.safeDistance=30;this.centerLabelOnFullPeriod=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},{period:"ss",count:10},{period:"ss",count:30},{period:"mm",count:1},{period:"mm",count:5},{period:"mm",count:10},{period:"mm",count:30},{period:"hh",count:1},{period:"hh",count:3},{period:"hh",count:6},{period:"hh",count:12},{period:"DD",count:1},{period:"DD",count:2},{period:"DD",count:3},{period:"DD",count:4},{period:"DD",count:5},{period:"WW",count:1},{period:"MM",count:1},{period:"MM",count:2},{period:"MM",count:3},{period:"MM",count:6},{period:"YYYY",count:1},{period:"YYYY",count:2},{period:"YYYY",count:5},{period:"YYYY",count:10},{period:"YYYY",count:50},{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={};this.nextPeriod.fff="ss";this.nextPeriod.ss="mm";this.nextPeriod.mm="hh";this.nextPeriod.hh="DD";this.nextPeriod.DD="MM";this.nextPeriod.MM="YYYY";AmCharts.applyTheme(this,t,this.cname)},draw:function(){AmCharts.CategoryAxis.base.draw.call(this);this.generateDFObject();var t=this.chart.chartData;this.data=t;if(AmCharts.ifArray(t)){var e,i=this.chart;"scrollbar"!=this.id?(AmCharts.setCN(i,this.set,"category-axis"),AmCharts.setCN(i,this.labelsSet,"category-axis"),AmCharts.setCN(i,this.axisLine.axisSet,"category-axis")):this.bcn=this.id+"-";var s=this.start,a=this.labelFrequency,h=0;e=this.end-s+1;var r=this.gridCountR,o=this.showFirstLabel,n=this.showLastLabel,d,m="",l=AmCharts.extractPeriod(this.minPeriod);d=AmCharts.getPeriodDuration(l.period,l.count);var c,u,g,p,f,A;c=this.rotate;var C=this.firstDayOfWeek,x=this.boldPeriodBeginning,t=AmCharts.resetDateToMin(new Date(t[t.length-1].time+1.05*d),this.minPeriod,1,C).getTime(),D;this.endTime>t&&(this.endTime=t);A=this.minorGridEnabled;var v,t=this.gridAlpha,T;if(this.parseDates&&!this.equalSpacing){this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=l.period,c=l.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(this.timeDifference);var r=Math.ceil(this.timeDifference/u)+5,b=m=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,C).getTime();g==a&&1==c&&this.centerLabelOnFullPeriod&&(f=u*this.stepWidth);this.cellWidth=d*this.stepWidth;e=Math.round(m/u);s=-1;e/2==Math.round(e/2)&&(s=-2,m-=u);var N=i.firstTime,y=0;A&&1<c&&(v=this.chooseMinorFrequency(c),T=AmCharts.getPeriodDuration(a,v));if(0<this.gridCountR)for(e=s;e<=r;e++){l=N+u*(e+Math.floor((b-N)/u))-y;"DD"==a&&(l+=36e5);l=AmCharts.resetDateToMin(new Date(l),a,c,C).getTime();"MM"==a&&(A=(l-m)/u,1.5<=(l-m)/u&&(l=l-(A-1)*u+AmCharts.getPeriodDuration("DD",3),l=AmCharts.resetDateToMin(new Date(l),a,1).getTime(),y+=u));d=(l-this.startTime)*this.stepWidth;A=!1;this.nextPeriod[g]&&(A=this.checkPeriodChange(this.nextPeriod[g],1,l,m,g));D=!1;A&&this.markPeriodChange?(A=this.dateFormatsObject[this.nextPeriod[g]],this.twoLineMode&&(A=this.dateFormatsObject[g]+"\n"+A,A=AmCharts.fixBrakes(A)),D=!0):A=this.dateFormatsObject[g];x||(D=!1);m=AmCharts.formatDate(new Date(l),A,i);if(e==s&&!o||e==r&&!n)m=" ";this.labelFunction&&(m=this.labelFunction(m,new Date(l),this,a,c,p).toString());this.boldLabels&&(D=!0);p=new this.axisItemRenderer(this,d,m,!1,f,0,!1,D);this.pushAxisItem(p);p=m=l;if(!isNaN(v))for(d=1;d<c;d+=v)this.gridAlpha=this.minorGridAlpha,A=l+T*d,A=AmCharts.resetDateToMin(new Date(A),a,v,C).getTime(),A=new this.axisItemRenderer(this,(A-this.startTime)*this.stepWidth),this.pushAxisItem(A);this.gridAlpha=t}}else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(e),e<r&&(r=e),h+=this.start,this.stepWidth=this.getStepWidth(e),0<r)for(r=Math.floor(e/r),v=this.chooseMinorFrequency(r),d=h,d/2==Math.round(d/2)&&d--,0>d&&(d=0),C=0,this.end-d+1>=this.autoRotateCount&&(this.labelRotation=this.autoRotateAngle),e=d;e<=this.end+2;e++){x=!1;0<=e&&e<this.data.length?(g=this.data[e],m=g.category,x=g.forceShow):m="";if(A&&!isNaN(v))if(e/v==Math.round(e/v)||x)e/r==Math.round(e/r)||x||(this.gridAlpha=this.minorGridAlpha,m=void 0);else continue;else if(e/r!=Math.round(e/r)&&!x)continue;d=this.getCoordinate(e-h);p=0;"start"==this.gridPosition&&(d-=this.cellWidth/2,p=this.cellWidth/2);x=!0;b=p;"start"==this.tickPosition&&(b=0,x=!1,p=0);if(e==s&&!o||e==this.end&&!n)m=void 0;Math.round(C/a)!=C/a&&(m=void 0);C++;f=this.cellWidth;c&&(f=NaN);this.labelFunction&&g&&(m=this.labelFunction(m,g,this));m=AmCharts.fixBrakes(m);D=!1;this.boldLabels&&(D=!0);e>this.end&&"start"==this.tickPosition&&(m=" ");p=new this.axisItemRenderer(this,d,m,x,f,p,void 0,D,b,!1,g.labelColor,g.className);p.serialDataItem=g;this.pushAxisItem(p);this.gridAlpha=t}}else if(this.parseDates&&this.equalSpacing){h=this.start;this.startTime=this.data[this.start].time;this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=l.period,c=l.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(e);r=Math.ceil(this.timeDifference/u)+1;m=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,C).getTime();this.cellWidth=this.getStepWidth(e);e=Math.round(m/u);s=-1;e/2==Math.round(e/2)&&(s=-2,m-=u);d=this.start;d/2==Math.round(d/2)&&d--;0>d&&(d=0);f=this.end+2;f>=this.data.length&&(f=this.data.length);T=!1;T=!o;this.previousPos=-1e3;20<this.labelRotation&&(this.safeDistance=5);u=d;if(this.data[d].time!=AmCharts.resetDateToMin(new Date(this.data[d].time),a,c,C).getTime())for(C=0,D=m,e=d;e<f;e++)l=this.data[e].time,this.checkPeriodChange(a,c,l,D)&&(C++,2<=C&&(u=e,e=f),D=l);A&&1<c&&(v=this.chooseMinorFrequency(c),AmCharts.getPeriodDuration(a,v));if(0<this.gridCountR)for(e=d;e<f;e++)if(l=this.data[e].time,this.checkPeriodChange(a,c,l,m)&&e>=u){d=this.getCoordinate(e-this.start);A=!1;this.nextPeriod[g]&&(A=this.checkPeriodChange(this.nextPeriod[g],1,l,m,g));D=!1;A&&this.markPeriodChange?(A=this.dateFormatsObject[this.nextPeriod[g]],D=!0):A=this.dateFormatsObject[g];m=AmCharts.formatDate(new Date(l),A,i);if(e==s&&!o||e==r&&!n)m=" ";T?T=!1:(x||(D=!1),d-this.previousPos>this.safeDistance*Math.cos(this.labelRotation*Math.PI/180)&&(this.labelFunction&&(m=this.labelFunction(m,new Date(l),this,a,c,p)),this.boldLabels&&(D=!0),p=new this.axisItemRenderer(this,d,m,void 0,void 0,void 0,void 0,D),A=p.graphics(),this.pushAxisItem(p),p=A.getBBox().width,AmCharts.isModern||(p-=d),this.previousPos=d+p));p=m=l}else isNaN(v)||(this.checkPeriodChange(a,v,l,b)&&(this.gridAlpha=this.minorGridAlpha,d=this.getCoordinate(e-this.start),A=new this.axisItemRenderer(this,d),this.pushAxisItem(A),b=l),this.gridAlpha=t)}for(e=0;e<this.data.length;e++)if(o=this.data[e])n=this.parseDates&&!this.equalSpacing?Math.round((o.time-this.startTime)*this.stepWidth+this.cellWidth/2):this.getCoordinate(e-h),o.x[this.id]=n;o=this.guides.length;for(e=0;e<o;e++)n=this.guides[e],x=r=r=t=s=NaN,v=n.above,n.toCategory&&(r=i.getCategoryIndexByValue(n.toCategory),isNaN(r)||(s=this.getCoordinate(r-h),n.expand&&(s+=this.cellWidth/2),p=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(p,v))),n.category&&(x=i.getCategoryIndexByValue(n.category),isNaN(x)||(t=this.getCoordinate(x-h),n.expand&&(t-=this.cellWidth/2),r=(s-t)/2,p=new this.axisItemRenderer(this,t,n.label,!0,NaN,r,n),this.pushAxisItem(p,v))),x=i.dataDateFormat,n.toDate&&(n.toDate instanceof Date||(isNaN(n.toDate)?x&&(n.toDate=AmCharts.stringToDate(n.toDate,x)):n.toDate=new Date(n.toDate)),this.equalSpacing?(r=i.getClosestIndex(this.data,"time",n.toDate.getTime(),!1,0,this.data.length-1),isNaN(r)||(s=this.getCoordinate(r-h))):s=(n.toDate.getTime()-this.startTime)*this.stepWidth,p=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(p,v)),n.date&&(n.date instanceof Date||(isNaN(n.date)?x&&(n.date=AmCharts.stringToDate(n.date,x)):n.date=new Date(n.date)),this.equalSpacing?(x=i.getClosestIndex(this.data,"time",n.date.getTime(),!1,0,this.data.length-1),isNaN(x)||(t=this.getCoordinate(x-h))):t=(n.date.getTime()-this.startTime)*this.stepWidth,r=(s-t)/2,x=!0,n.toDate&&(x=!1),p="H"==this.orientation?new this.axisItemRenderer(this,t,n.label,x,2*r,NaN,n):new this.axisItemRenderer(this,t,n.label,!1,NaN,r,n),this.pushAxisItem(p,v)),(0<s||0<t)&&(s<this.width||t<this.width)&&(s=new this.guideFillRenderer(this,t,s,n),t=s.graphics(),this.pushAxisItem(s,v),n.graphics=t,t.index=e,n.balloonText&&this.addEventListeners(t,n))}this.axisCreated=!0;i=this.x;h=this.y;this.set.translate(i,h);this.labelsSet.translate(i,h);this.positionTitle();(i=this.axisLine.set)&&i.toFront();i=this.getBBox().height;2<i-this.previousHeight&&this.autoWrap&&!this.parseDates&&(this.axisCreated=this.chart.marginsUpdated=!1);this.previousHeight=i},chooseMinorFrequency:function(t){for(var e=10;0<e;e--)if(t/e==Math.round(t/e))return t/e},choosePeriod:function(t){var e=AmCharts.getPeriodDuration(this.periods[t].period,this.periods[t].count),i=Math.ceil(this.timeDifference/e),s=this.periods;return this.timeDifference<e&&0<t?s[t-1]:i<=this.gridCountR?s[t]:t+1<s.length?this.choosePeriod(t+1):s[t]},getStepWidth:function(t){var e;this.startOnAxis?(e=this.axisWidth/(t-1),1==t&&(e=this.axisWidth)):e=this.axisWidth/t;return e},getCoordinate:function(t){t*=this.stepWidth;this.startOnAxis||(t+=this.stepWidth/2);return Math.round(t)},timeZoom:function(t,e){this.startTime=t;this.endTime=e},minDuration:function(){var t=AmCharts.extractPeriod(this.minPeriod);return AmCharts.getPeriodDuration(t.period,t.count)},checkPeriodChange:function(t,e,i,s,a){i=new Date(i);var h=new Date(s),r=this.firstDayOfWeek;s=e;"DD"==t&&(e=1);i=AmCharts.resetDateToMin(i,t,e,r).getTime();e=AmCharts.resetDateToMin(h,t,e,r).getTime();return"DD"==t&&"hh"!=a&&i-e<=AmCharts.getPeriodDuration(t,s)?!1:i!=e?!0:!1},generateDFObject:function(){this.dateFormatsObject={};var t;for(t=0;t<this.dateFormats.length;t++){var e=this.dateFormats[t];this.dateFormatsObject[e.period]=e.format}},xToIndex:function(t){var e=this.data,i=this.chart,s=i.rotate,a=this.stepWidth;this.parseDates&&!this.equalSpacing?(t=this.startTime+Math.round(t/a)-this.minDuration()/2,i=i.getClosestIndex(e,"time",t,!1,this.start,this.end+1)):(this.startOnAxis||(t-=a/2),i=this.start+Math.round(t/a));var i=AmCharts.fitToBounds(i,0,e.length-1),h;e[i]&&(h=e[i].x[this.id]);s?h>this.height+1&&i--:h>this.width+1&&i--;0>h&&i++;return i=AmCharts.fitToBounds(i,0,e.length-1)},dateToCoordinate:function(t){return this.parseDates&&!this.equalSpacing?(t.getTime()-this.startTime)*this.stepWidth:this.parseDates&&this.equalSpacing?(t=this.chart.getClosestIndex(this.data,"time",t.getTime(),!1,0,this.data.length-1),this.getCoordinate(t-this.start)):NaN},categoryToCoordinate:function(t){return this.chart?(t=this.chart.getCategoryIndexByValue(t),this.getCoordinate(t-this.start)):NaN},coordinateToDate:function(t){return this.equalSpacing?(t=this.xToIndex(t),new Date(this.data[t].time)):new Date(this.startTime+t/this.stepWidth)}});
//# sourceMappingURL=serial.map.js